#ifndef LOGIN_MANAGER_H
#define LOGIN_MANAGER_H

#include <QObject>
#include <QTimer>

#include "account_qrcode.h"
#include "scan_check.h"
#include "login_server.h"
#include "info_init.h"
#include "contact_info.h"
#include "sync_check.h"
#include "get_msg.h"
#include "send_msg.h"
#include "tuling_robot.h"
#include "stat_report.h"
#include "status_notify.h"

class Login_Manager : public QObject
{
    Q_OBJECT
public:
    explicit Login_Manager(QObject *parent = 0);

signals:

public slots:
    void uuid_ok(QString uuid);
    void scan_error();
    void scan_ok(QString uuid);
	void login_ok(QString uin, QString sid, QString ticket);
	void init_ok(QString userName, QString nickName, QString skey, QStringList syncKey, QString device_id);
	void contact_ok();
	void timer_to_check();
    void sync_error();
	void msg_state(bool has_newmsg);
	void msg_ok(QStringList sync_key);
	void received_msg(int createTime, QString fromUserNameStr, QString toUserNameStr, QString content);
	void robot_respond(QString userid, QString context);

private:
    void send_msg_to_user(QString userid, QString context);

private:
	Account_Qrcode	*account;
    Scan_Check      *scan_check;
	Login_Server	*login_server;
	Info_Init		*info_init;
	Contact_Info	*contact_info;
	Sync_Check		*sync_check;
	Get_Msg			*get_msg;
	Send_Msg		*send_msg;
	Tuling_Robot	*robot;
    Stat_Report     *stat_report;
    Status_Notify   *status_notify;

    QString m_uuid;
	QString m_uin;
	QString m_sid;
	QString m_device_id;
	QString m_skey;
	QStringList m_sync_key;

	QString m_loginUserName;
	QString m_loginNickName;
    QString m_replace_str;

	QTimer *m_check_timer;

    bool m_group_auto_respond;
    bool m_private_auto_respond;
};

#endif // LOGIN_MANAGER_H
